package cn.iocoder.yudao.module.peizhen.dal.mysql.opencity;


import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.peizhen.dal.dataobject.opencity.ProgramDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 具体服务 Mapper
 *
 * @author duanxinli
 */
@Mapper
public interface ProgramMapper extends BaseMapperX<ProgramDO> {

    default PageResult<ProgramDO> selectPage(PageParam reqVO, Integer cityCode) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProgramDO>()
            .eq(ProgramDO::getCityCode, cityCode)
            .orderByDesc(ProgramDO::getId));
    }

    default int deleteByCityCode(Integer cityCode) {
        return delete(ProgramDO::getCityCode, cityCode);
    }

}
